<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title>文档-linux安装 | Perfree</title>
    <meta name="description" content="">
    <meta name="generator" content="VuePress 1.8.2">
    <link rel="icon" href="/assets/favicon.ico">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.slim.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.2/jquery.fancybox.min.js"></script>
    <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.2/jquery.fancybox.min.css">
    <meta name="description" content="Java开发的建站平台">
    <link rel="preload" href="/assets/css/0.styles.53214819.css" as="style"><link rel="preload" href="/assets/js/app.94968a94.js" as="script"><link rel="preload" href="/assets/js/2.fdc7bca3.js" as="script"><link rel="preload" href="/assets/js/10.0ff33afc.js" as="script"><link rel="prefetch" href="/assets/js/11.c36dbcc6.js"><link rel="prefetch" href="/assets/js/12.92c9567c.js"><link rel="prefetch" href="/assets/js/13.c09257d0.js"><link rel="prefetch" href="/assets/js/14.715bbb46.js"><link rel="prefetch" href="/assets/js/15.e222f376.js"><link rel="prefetch" href="/assets/js/16.bb221be4.js"><link rel="prefetch" href="/assets/js/17.cda3dfb0.js"><link rel="prefetch" href="/assets/js/18.e2582183.js"><link rel="prefetch" href="/assets/js/3.f4d43266.js"><link rel="prefetch" href="/assets/js/4.e03bce9c.js"><link rel="prefetch" href="/assets/js/5.cf1c3294.js"><link rel="prefetch" href="/assets/js/6.d12ee77a.js"><link rel="prefetch" href="/assets/js/7.e7442db3.js"><link rel="prefetch" href="/assets/js/8.a73d51d6.js"><link rel="prefetch" href="/assets/js/9.169d2690.js">
    <link rel="stylesheet" href="/assets/css/0.styles.53214819.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="ant-row"><div class="sidebar-button"><i aria-label="icon: bars" class="anticon anticon-bars"><svg viewBox="0 0 1024 1024" focusable="false" data-icon="bars" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 1 0 112 0 56 56 0 1 0-112 0zm0 284a56 56 0 1 0 112 0 56 56 0 1 0-112 0zm0 284a56 56 0 1 0 112 0 56 56 0 1 0-112 0z"></path></svg></i> <span></span></div> <div class="ant-col ant-col-xs-24 ant-col-sm-24 ant-col-md-6 ant-col-lg-5 ant-col-xl-5 ant-col-xxl-4"><a href="/" class="router-link-active home-link"><img src="/assets/logo.png" alt="Perfree" class="logo"> <span class="site-name">Perfree</span></a> <div class="search-box mobile-search"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div></div> <div class="ant-col ant-col-xs-0 ant-col-sm-0 ant-col-md-18 ant-col-lg-19 ant-col-xl-19 ant-col-xxl-20"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><ul role="menu" id="nav" class="ant-menu ant-menu-horizontal ant-menu-root ant-menu-light"><li role="menuitem" class="ant-menu-submenu ant-menu-submenu-horizontal ant-menu-overflowed-submenu" style="display:none;"><div aria-haspopup="true" class="ant-menu-submenu-title"><span>···</span><i class="ant-menu-submenu-arrow"></i></div></li><li role="menuitem" class="ant-menu-item"><a href="/" class="router-link-active">
          首页
        </a></li><li role="menuitem" class="ant-menu-submenu ant-menu-submenu-horizontal ant-menu-overflowed-submenu" style="display:none;"><div aria-haspopup="true" class="ant-menu-submenu-title"><span>···</span><i class="ant-menu-submenu-arrow"></i></div></li><li role="menuitem" class="ant-menu-item"><a href="/doc/update-record.html">
          更新日志
        </a></li><li role="menuitem" class="ant-menu-submenu ant-menu-submenu-horizontal ant-menu-overflowed-submenu" style="display:none;"><div aria-haspopup="true" class="ant-menu-submenu-title"><span>···</span><i class="ant-menu-submenu-arrow"></i></div></li><li role="menuitem" class="ant-menu-item ant-menu-item-selected"><a href="/doc/" class="router-link-active">
          文档
        </a></li><li role="menuitem" class="ant-menu-submenu ant-menu-submenu-horizontal ant-menu-overflowed-submenu" style="display:none;"><div aria-haspopup="true" class="ant-menu-submenu-title"><span>···</span><i class="ant-menu-submenu-arrow"></i></div></li><li role="menuitem" class="ant-menu-item"><a href="/theme-download/">
          主题下载
        </a></li><li role="menuitem" class="ant-menu-submenu ant-menu-submenu-horizontal ant-menu-overflowed-submenu" style="display:none;"><div aria-haspopup="true" class="ant-menu-submenu-title"><span>···</span><i class="ant-menu-submenu-arrow"></i></div></li><li role="menuitem" class="ant-menu-item"><a href="/theme-develop/">
          主题开发
        </a></li><li role="menuitem" class="ant-menu-submenu ant-menu-submenu-horizontal ant-menu-overflowed-submenu" style="visibility:hidden;position:absolute;"><div aria-haspopup="true" class="ant-menu-submenu-title"><span>···</span><i class="ant-menu-submenu-arrow"></i></div></li></ul> <a href="https://github.com/perfree/PerfreeBlog" target="_blank" rel="noopener noreferrer" class="repo-link"><i aria-label="icon: github" class="anticon anticon-github"><svg viewBox="64 64 896 896" focusable="false" data-icon="github" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M511.6 76.3C264.3 76.2 64 276.4 64 523.5 64 718.9 189.3 885 363.8 946c23.5 5.9 19.9-10.8 19.9-22.2v-77.5c-135.7 15.9-141.2-73.9-150.3-88.9C215 726 171.5 718 184.5 703c30.9-15.9 62.4 4 98.9 57.9 26.4 39.1 77.9 32.5 104 26 5.7-23.5 17.9-44.5 34.7-60.8-140.6-25.2-199.2-111-199.2-213 0-49.5 16.3-95 48.3-131.7-20.4-60.5 1.9-112.3 4.9-120 58.1-5.2 118.5 41.6 123.2 45.3 33-8.9 70.7-13.6 112.9-13.6 42.4 0 80.2 4.9 113.5 13.9 11.3-8.6 67.3-48.8 121.3-43.9 2.9 7.7 24.7 58.3 5.5 118 32.4 36.8 48.9 82.7 48.9 132.3 0 102.2-59 188.1-200 212.9a127.5 127.5 0 0 1 38.1 91v112.5c.8 9 0 17.9 15 17.9 177.1-59.7 304.6-227 304.6-424.1 0-247.2-200.4-447.3-447.5-447.3z"></path></svg></i></a></nav></div></div> <!----></header> <aside class="sidebar"><!----> <ul class="sidebar-links"><li><a href="/doc/" aria-current="page" title="项目介绍" class="sidebar-link">项目介绍</a></li><li><a href="/doc/install-linux.html" aria-current="page" title="Linux安装" class="active sidebar-link">Linux安装</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/doc/install-linux.html#下载" title="下载" class="sidebar-link">下载</a></li><li class="sidebar-sub-header"><a href="/doc/install-linux.html#环境配置" title="环境配置" class="sidebar-link">环境配置</a></li><li class="sidebar-sub-header"><a href="/doc/install-linux.html#安装perfreeblog" title="安装PerfreeBlog" class="sidebar-link">安装PerfreeBlog</a></li><li class="sidebar-sub-header"><a href="/doc/install-linux.html#启动" title="启动" class="sidebar-link">启动</a></li><li class="sidebar-sub-header"><a href="/doc/install-linux.html#访问" title="访问" class="sidebar-link">访问</a></li></ul></li><li><a href="/doc/install-windows.html" title="Windows安装" class="sidebar-link">Windows安装</a></li><li><a href="/doc/install-docker.html" title="Docker安装" class="sidebar-link">Docker安装</a></li><li><a href="/doc/install-config.html" title="基础配置" class="sidebar-link">基础配置</a></li><li><a href="/doc/install-update.html" title="更新教程" class="sidebar-link">更新教程</a></li><li><a href="/doc/update-record.html" title="更新日志" class="sidebar-link">更新日志</a></li></ul></aside> <main class="page"> <div class="theme-antdocs-content content__default"><h2 id="下载"><a href="#下载" class="header-anchor">#</a> 下载</h2> <blockquote><p>本教程以 CentOS 7.x 为例，其他 Linux 发行版基本一致。</p></blockquote> <p>首先将PerfreeBlog下载至本地备用,以便后续步骤,Linux推荐下载tar.gz安装包,Windows推荐下载zip安装包</p> <ul><li>下载地址一: github <a href="https://github.com/perfree/PerfreeBlog/releases" target="_blank" rel="noopener noreferrer">https://github.com/perfree/PerfreeBlog/releases<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li>下载地址二: gitee <a href="https://gitee.com/perfree/PerfreeBlog/releases" target="_blank" rel="noopener noreferrer">https://gitee.com/perfree/PerfreeBlog/releases<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul> <h2 id="环境配置"><a href="#环境配置" class="header-anchor">#</a> 环境配置</h2> <p>请确保服务器的软件包为最新</p> <div class="language-bash line-numbers-mode"><pre class="language-bash"><code><span class="token function">sudo</span> yum update -y
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>安装java运行环境(已安装的请忽略)</p> <div class="language-bash line-numbers-mode"><pre class="language-bash"><code><span class="token comment"># 安装 OpenJRE</span>
<span class="token function">sudo</span> yum <span class="token function">install</span> java-1.8.0-openjdk -y

<span class="token comment"># 检测是否安装成功</span>
java -version
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br></div></div><blockquote><p>PerfreeBlog支持mysql和sqlite数据库,推荐数据库为mysql数据库,可参考<a href="https://www.runoob.com/mysql/mysql-install.html" target="_blank" rel="noopener noreferrer">MySQL 安装<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>,当然也可以选择使用sqlite数据库,无需安装</p></blockquote> <h2 id="安装perfreeblog"><a href="#安装perfreeblog" class="header-anchor">#</a> 安装PerfreeBlog</h2> <p>将下载的Perfree安装包上传至服务器,解压压缩包</p> <div class="language-bash line-numbers-mode"><pre class="language-bash"><code> <span class="token function">tar</span> zxvf perfree-web-xxx.tar.gz
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>进入解压后的目录</p> <div class="language-bash line-numbers-mode"><pre class="language-bash"><code><span class="token builtin class-name">cd</span> perfree-web
<span class="token function">ls</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div><p>将会看到目录内有如下文件</p> <p><a data-fancybox="" title="目录" href="/assets/doc/7.png"><img src="/assets/doc/7.png" alt="目录"></a></p> <h2 id="启动"><a href="#启动" class="header-anchor">#</a> 启动</h2> <div class="language-bash line-numbers-mode"><pre class="language-bash"><code>./start.sh start
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>如遇到<code>-bash: ./start.sh: /bin/bash^M: 坏的解释器: 没有那个文件或目录</code>错误,则执行以下命令</p> <div class="language-bash line-numbers-mode"><pre class="language-bash"><code><span class="token function">sed</span> -i <span class="token string">'s/<span class="token entity" title="\r">\r</span>//'</span> ./start.sh
./start.sh start
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div><p>执行完毕会在终端显示如下信息</p> <p><a data-fancybox="" title="安装成功" href="/assets/doc/8.png"><img src="/assets/doc/8.png" alt="安装成功"></a></p> <p>常用命令</p> <div class="language-bash line-numbers-mode"><pre class="language-bash"><code><span class="token comment"># 运行</span>
./start.sh start

<span class="token comment"># 查看运行状态</span>
./start.sh status

<span class="token comment"># 重新启动</span>
./start.sh restart

<span class="token comment"># 停止</span>
./start.sh stop
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br></div></div><h2 id="访问"><a href="#访问" class="header-anchor">#</a> 访问</h2> <blockquote><p>默认端口8080,如访问不到请查看服务器防火墙是否开启8080端口的访问权限,如需更改默认端口请查看<a href="">更换端口</a></p></blockquote> <p>启动完成后,访问http://服务器ip:8080进入安装页,按照提示进行配置即可
<a data-fancybox="" title="安装页" href="/assets/doc/9.png"><img src="/assets/doc/9.png" alt="安装页"></a></p></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">Last Updated:</span> <span class="time">8/11/2021, 3:43:19 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev"><a href="/doc/" class="prev router-link-active"><i aria-label="icon: left" class="anticon anticon-left"><svg viewBox="64 64 896 896" focusable="false" data-icon="left" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 0 0 0 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"></path></svg></i>
        项目介绍
      </a></span> <span class="next"><a href="/doc/install-windows.html">
        Windows安装
        <i aria-label="icon: right" class="anticon anticon-right"><svg viewBox="64 64 896 896" focusable="false" data-icon="right" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M765.7 486.8L314.9 134.7A7.97 7.97 0 0 0 302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 0 0 0-50.4z"></path></svg></i></a></span></p></div> </main> <!----></div><div class="global-ui"></div></div>
    <script src="/assets/js/app.94968a94.js" defer></script><script src="/assets/js/2.fdc7bca3.js" defer></script><script src="/assets/js/10.0ff33afc.js" defer></script>
  </body>
</html>